﻿﻿// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.

using Microsoft.ServiceBus.Messaging;

namespace Nardax.Azure.ServiceBus
{
    public class MessageSenderWrapper : IMessageSender
    {
        private readonly TopicClient _topicClient;

        public MessageSenderWrapper(string connectionString, string path)
        {
            _topicClient = TopicClient.CreateFromConnectionString(connectionString, path);
        }

        public void Send(BrokeredMessage message)
        {
            _topicClient.Send(message);
        }

        public string Namespace
        {
            get { return _topicClient.MessagingFactory.Address.DnsSafeHost; }
        }

        public string Path
        {
            get { return _topicClient.Path; }
        }
    }
}
